package com.java.grammer.arrays;

import java.util.Arrays;

/**
 * @author luzhikun
 * @date 2020/11/28- 20:23
 */
public class Array_Test4 {
    public static void main(String[] args) {
        int[] a = new int[10];
        //数组动态赋值
        for (int i = 0; i < a.length; i++) {
            a[i] = i;
            System.out.print(a[i] + " ");
        }
        System.out.println();
        //数组翻转
        for (int i = 0; i < a.length / 2; i++) {
            int t = a[i];
            a[i] = a[a.length - 1 - i];
            a[a.length - 1 - i] = t;
        }
        //数组打印
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a.toString());
        System.out.println(Arrays.toString(a));
    }
}
